cmake_minimum_required(VERSION 2.6)

project(tinysharing)

SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)

#set include/lib path
set(LOCAL_INCLUDE_DIR /usr/local/include)
set(OPT_INCLUDE_DIR /opt/local/include)
set(LOCAL_LIB_DIR /usr/local/lib)
set(OPT_LIB_DIR /opt/local/lib)

#set boost lib path
FIND_LIBRARY(BOOST_THREAD_LIB_FILE NAMES boost_thread boost_thread-mt PATHS /usr/lib/ /usr/local/lib /opt/local/lib)

set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Wall)
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -Wall)

set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb")
set(CMAKE_C_FLAGS_DEBUG "$ENV{CFLAGS} -O0 -Wall -g -ggdb")

set(CMAKE_CXX_FLAGS_REALEASE "$ENV{CXXFLAGS} -O3 -Wall")
set(CMAKE_C_FLAGS_REALEASE "$ENV{CFLAGS} -O3 -Wall")

set(PROJECT_SERVER_DIR ${PROJECT_SOURCE_DIR}/src/server)
set(PROJECT_CLIENT_DIR ${PROJECT_SOURCE_DIR}/src/client)
set(PROJECT_SHARED_DIR ${PROJECT_SOURCE_DIR}/src/share)

add_subdirectory(src)
add_subdirectory(test)
